package cn.mafangui.hotel.service.impl;

import cn.mafangui.hotel.entity.Dishes;
import cn.mafangui.hotel.entity.Notice;
import cn.mafangui.hotel.mapper.DishesMapper;
import cn.mafangui.hotel.mapper.NoticeMapper;
import cn.mafangui.hotel.service.DishesService;
import cn.mafangui.hotel.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishesServiceImpl implements DishesService {

    @Autowired
    private DishesMapper noticeMapper;

    @Override
    public int insert(Dishes notice) {
        return noticeMapper.insert(notice);
    }

    @Override
    public int delete(Integer id) {
        return noticeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Dishes selectById(Integer id) {
        return noticeMapper.selectByPrimaryKey(id);
    }

    @Override
    public int update(Dishes record) {
        return noticeMapper.updateByPrimaryKey(record);
    }

    @Override
    public Integer getDishesCount() {
        return noticeMapper.getDishesCount();
    }

    @Override
    public List<Dishes> selectByUserId(int userId) {
        return noticeMapper.selectByUserId(userId);
    }

    @Override
    public List<Dishes> AllNotices() {
        return noticeMapper.selectAll();
    }

}
